/* ====================================================================
 * (#)Header: JmsSenderTest.java
 * (#)Revision: 
 * (#)Date Created: 02-Nov-09 10:32:15 AM
 * (#)Created By: Karol Wozniak
 * ====================================================================
 *
 * Copyright (c) 2007 karolak .  All rights reserved.
 *
 * ====================================================================
 * 
 * The software application represented here is the sole property of 
 * karolak. Its unauthorized utilization is expressly prohibited.
 * 
 * ====================================================================
 */
package com.karolak.jms;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * <code>JmsSenderTest</code> is used to ....
 * 
 * @author <a href="mailto:kwozniak@hotmail.com">Karol Wozniak</a>
 */
public class JmsSenderIT {

	private static JmsSender sender;

	@BeforeClass
	public static void init() throws Exception {
		String destinationJndiName = "queue/ForumChannel";
		sender = new JmsSender(destinationJndiName);
		sender.start();
	}

	@AfterClass
	public static void destroy() throws Exception {
		sender.close();
	}

	@Test
	public void testSend() throws Exception {
		for (int i = 0; i < 10000 ; i++) {
			sender.sendMessage(i + " - hello world");
		}
//		sender.sendMessage("exit");
	}
}
